#include "cell.h"
void Block::_allocate_mem()
{
  assert(_num_rows>0 && _num_cols>0);
  assert(_cell);
  for (int i = 0; i < _num_rows; ++i)
    _cell[i] = new Cell[_num_cols];
}

Block::Block(int rows, int cols)
  : _num_rows(rows), _num_cols(cols), _cell(new (Cell*)[_num_rows])
{
  _allocate_mem();
}

Block::~Block()
{
  assert(_num_rows>0);
  for (int i = 0; i < _num_rows; ++i)
    delete []_cell[i]
  delete []_cell;
  _cell = 0;
}
